<?php
	include("../tool/UpFileTool.class.php");
	error_reporting(0);
    
    class MyBean{
	
	public $code;
	public $msg;
	public $sumbImage;
	public $srcimages;

	function __construct($code,$msg,$sumbImage,$srcimages){
		$this->code      = $code;
		$this->msg      = $msg;
		$this->sumbImage      = $sumbImage;
		$this->srcimages      = $srcimages;
		
	}
  }
    
    try{
        $UpFileTool=new UpFileTool('upfile');
	    $UpFileTool->upImage($w=500, $h=500 ,$sumbimage='../sumbimage', $srcimage='../srcimage');
	    $images=$UpFileTool->sumbImage;
	    $srcimages=$UpFileTool->srcImage;

        $obj = new MyBean("200","上传成功",substr($images,3,strlen($images)-1),substr($srcimages,3,strlen($srcimages)-1));
        echo json_encode($obj);
    }
	//捕获异常
	catch(Exception $e)
	 {
	   $obj = new MyBean("201","上传失败");
	   echo json_encode($obj);
	 }
    
?>